package com.netistate.dao;

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.netistate.base.BaseDao;
import com.netistate.pojo.Device;

@Repository
public class DeviceDao extends BaseDao<Device, Integer> {

	/**
	 * 进来查找设备中的Demo
	 * @return
	 */
	@SuppressWarnings("unchecked")
	public List<Device> findAllDeviceDemo() {

		//isDemoOrProduct字段用来判别是否为DEMO或者是产品,0的话就是DEMO机。
		String hql = "from Device where isDemoOrProduct ='"+0+"'";
		Query query = getSession().createQuery(hql);
		return query.list();
	}
}
